package cn.gson.tj_springboot.model.pojos;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import java.sql.Date;
import java.util.Objects;

@Entity
public class Demand {
    private int demandId;
    private String kh;
    private String jh;
    private String demandTheme;
    private Integer demandImportant;
    private Date demandTime;
    private String demandContent;

    @Id
    @Column(name = "demand_id", nullable = false)
    public int getDemandId() {
        return demandId;
    }

    public void setDemandId(int demandId) {
        this.demandId = demandId;
    }

    @Basic
    @Column(name = "kh", nullable = true, length = 255)
    public String getKh() {
        return kh;
    }

    public void setKh(String kh) {
        this.kh = kh;
    }

    @Basic
    @Column(name = "jh", nullable = true, length = 255)
    public String getJh() {
        return jh;
    }

    public void setJh(String jh) {
        this.jh = jh;
    }

    @Basic
    @Column(name = "demand_theme", nullable = true, length = 255)
    public String getDemandTheme() {
        return demandTheme;
    }

    public void setDemandTheme(String demandTheme) {
        this.demandTheme = demandTheme;
    }

    @Basic
    @Column(name = "demand_important", nullable = true)
    public Integer getDemandImportant() {
        return demandImportant;
    }

    public void setDemandImportant(Integer demandImportant) {
        this.demandImportant = demandImportant;
    }

    @Basic
    @Column(name = "demand_time", nullable = true)
    public Date getDemandTime() {
        return demandTime;
    }

    public void setDemandTime(Date demandTime) {
        this.demandTime = demandTime;
    }

    @Basic
    @Column(name = "demand_content", nullable = true, length = 255)
    public String getDemandContent() {
        return demandContent;
    }

    public void setDemandContent(String demandContent) {
        this.demandContent = demandContent;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Demand demand = (Demand) o;
        return demandId == demand.demandId &&
                Objects.equals(kh, demand.kh) &&
                Objects.equals(jh, demand.jh) &&
                Objects.equals(demandTheme, demand.demandTheme) &&
                Objects.equals(demandImportant, demand.demandImportant) &&
                Objects.equals(demandTime, demand.demandTime) &&
                Objects.equals(demandContent, demand.demandContent);
    }

    @Override
    public int hashCode() {
        return Objects.hash(demandId, kh, jh, demandTheme, demandImportant, demandTime, demandContent);
    }
}
